//
//  UserModel.m
//  陶瓷
//
//  Created by 郭天龙 on 15/6/30.
//  Copyright (c) 2015年 王戈. All rights reserved.
//

#import "UserModel.h"

@interface UserModel ()

@property (nonatomic ,copy) NSString *Balance;
@property (nonatomic ,copy) NSString *CollectCount;
@property (nonatomic ,copy) NSString *Email;
@property (nonatomic ,copy) NSString *HeadImage;
@property (nonatomic ,copy) NSString *Level;
@property (nonatomic ,copy) NSString *NickName;
@property (nonatomic ,copy) NSString *ReleaseCount;

@property (nonatomic, copy) NSString *userName;
@property (nonatomic, copy) NSString *token;
@property (nonatomic, copy) NSString *token_type;

@end

@implementation UserModel

- (void)setTokenDict:(NSDictionary *)tokenDict {
    _tokenDict = tokenDict;
    self.userName = [tokenDict objectForKey:@"userName"];
    self.token = [tokenDict objectForKey:@"access_token"];
    self.token_type = [tokenDict objectForKey:@"token_type"];
}

- (void)setInfoDict:(NSDictionary *)infoDict {
    _infoDict = infoDict;
    self.Balance = [infoDict objectForKey:@"Balance"];
    self.CollectCount = [infoDict objectForKey:@"CollectCount"];
    self.Email = [infoDict objectForKey:@"Email"];
    self.HeadImage = [infoDict objectForKey:@"HeadImage"];
    self.Level = [infoDict objectForKey:@"Level"];
    self.NickName = [infoDict objectForKey:@"NickName"];
    self.ReleaseCount = [infoDict objectForKey:@"ReleaseCount"];
}

- (void)encodeWithCoder:(NSCoder *)encoder {
    [encoder encodeObject:self.Balance forKey:@"Balance"];
    [encoder encodeObject:self.CollectCount forKey:@"CollectCount"];
    [encoder encodeObject:self.Email forKey:@"Email"];
    [encoder encodeObject:self.HeadImage forKey:@"HeadImage"];
    [encoder encodeObject:self.Level forKey:@"Level"];
    [encoder encodeObject:self.NickName forKey:@"NickName"];
    [encoder encodeObject:self.ReleaseCount forKey:@"ReleaseCount"];

}

- (id)initWithCoder:(NSCoder *)decoder {
    if (self = [super init]) {
        self.Balance = [decoder decodeObjectForKey:@"Balance"];
        self.CollectCount = [decoder decodeObjectForKey:@"CollectCount"];
        self.Email = [decoder decodeObjectForKey:@"Email"];
        self.HeadImage = [decoder decodeObjectForKey:@"HeadImage"];
        self.Level = [decoder decodeObjectForKey:@"Level"];
        self.NickName = [decoder decodeObjectForKey:@"NickName"];
        self.ReleaseCount = [decoder decodeObjectForKey:@"ReleaseCount"];
    }
    return self;
}

@end
